home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk4 / acron24a / amicron.doc < prev    next >
Text File  |  1995-03-18  |  8KB  |  184 lines

  1.                     AmiCron - Cron task for the Amiga
  2.  
  3. Following below is the original AmiCron documentation by Rick
  4. Schaeffer (Version 2.3). I changed it were necessary and listed
  5. additional features below.
  6. <CB>
  7.  
  8. This is a (no longer) crude but effective version of the Unix (tm) 
  9. program known as "cron" modified to run on an Amiga.  For those 
  10. who aren't Unix knowledgeable, cron is a background task which 
  11. uses a disk-resident table to automatically run certain tasks on a 
  12. regular basis.  The cron table's format is very simple...it 
  13. contains entries in the form of lines where each line has 6 fields 
  14. and each field is separated by "white space" (either tabs or 
  15. spaces) from it's neighbor. The fields are as follows:
  16.  
  17.    1.  Minute       (0-59)
  18.    2.  Hour         (0-23)
  19.    3.  Day          (1-31)    (now works, <CB>)
  20.    4.  Month        (1-12) 
  21.    5.  Day of week  (0-6 where 0=Sunday and 6=Saturday)
  22.    6.  Command      This is the command to be run at the appointed 
  23.                     time.  It will be run just as if typed into 
  24.                     the CLI.
  25.  
  26. Each of the first 5 fields are numbers.  However, it is 
  27. permissable to use an asterisk (*) in a field to mean ALL possible 
  28. numbers for that field,  and you can specify a series of numbers 
  29. separated by commas (,) and ranges separated by dashes (-).  For 
  30. instance, in the Day field you could specify "1,5,10" to mean the 
  31. first, fifth, and tenth days of the month; or you could specify 
  32. "1-15" to mean the first through the fifteenth of the month.  Here 
  33. are some examples of Amicron table entries:
  34.  
  35.       Print the date in the crontask window every minute:
  36.           * * * * * date
  37.   
  38.       Print the date in the crontask window on the hour, every hour:
  39.           0 * * * * date
  40.   
  41.       Run uupc at 4:30 am every day except Sat and Sun:
  42.           30 4 * * 1-5 uupc -siscuva
  43.   
  44.       Incrementally backup the files every other day at 7:30 pm:
  45.           30 19 * * 1,3,5 sdbackup -l -s LAST dh0: incbkup_1:
  46.  
  47.         Backup the files on the 1st and 15th of each month at 1:00 am:
  48.             00 01 1,15 * * sdbackup -l dh0: SemiBkup_1:
  49.  
  50. The Amicron table file is by default located using the following path:
  51.  
  52.     S:    (or S:CronTab to be exact and include the filename)
  53.  
  54. but you now may specify a complete path (including filename!) for
  55. the CronTab file (which needn't but should have this name) as a
  56. command line parameter like this:
  57.  
  58.     Amicron RAM:MyCronTab
  59.  
  60. which would cause Amicron to use the CronTab file "MyCronTab"
  61. located in the RAM: disk and not to access a disk drive every minute
  62. to read in the CronTab file.
  63.  
  64. Crontab entries *MUST* be left justified starting in column 1 and 
  65. each entry must contain 6 fields, each separated by spaces or 
  66. tabs.
  67.  
  68. To run Amicron, you must use your favorite editor to create the
  69. "CronTab" file.  Amicron needs a CLI window for displaying the 
  70. output of the commands it runs...but it can be made as small or 
  71. large as you wish.  Assuming that you have placed Amicron in your 
  72. command directory (c:), you can start it by typing the following 
  73. line into a "newcli" window:
  74.     Amicron
  75. Then you can size and move the window anywhere you want, just be 
  76. sure not to type anything else into the window because that would 
  77. prevent cron tasks from running (read: printing something in that 
  78. window).
  79.  
  80. I have an entry in my startup-sequence file that looks like this:
  81.    run newcli con:0/140/160/50/CronTask s:startcron
  82. The "s:startcron" file contains one line:
  83.    Amicron
  84. This automatically sets up a tiny CronTask window and runs Amicron 
  85. in it.
  86.  
  87. This program was originally written by Steve R.  Sampson (UUCP:
  88. sys1!killer!sampson), who very kindly responded to my request for
  89. a PD cron that I could port to Minix.  I haven't done that yet
  90. (My new Amiga 2000 came in right after I received the cron
  91. program <grin>) but will do so ASAP.  The modifications to make
  92. it run on the Amiga were very minor!
  93.  
  94. Rick Schaeffer          UUCP:  seismo!uunet!iscuva!ricks
  95. E. 13611 26th Ave.      Phone: (509)928-3533
  96. Spokane, WA  99216
  97.  
  98. ---- Changes up to Version 2.4
  99. V2.31& V2.32
  100. Besides changing the paths for CronTab (s:) & CronErr (t:) to more
  101. decent Amiga places, I encountered a bug when I wanted to start
  102. cron a special program on xmas. After some investigation I found
  103. out that the localtime() function returns months only in the range
  104. from  0 to 11. So it was not surprising  that my "12" in the month
  105. field of CronTab was completely ignored. 
  106. To not have the user adapt to the computer by having him to supply
  107. months in the range from 0 to 11, I now increase the localtime()
  108. month by one, so the documentation above is correct again. 
  109.  
  110. V2.33
  111. Then I started wondering what that CronErr file was doing in the
  112. first place, since all errors where displayed in the CLI window.
  113. That instantly lead to the removal of this Unix artefact.
  114. I'm aware of the need for a stderr output, nevertheless Cron should
  115. always be attached to a CLI, so we can get rid of CronErr. 
  116.  
  117. V2.4 (a = Aztec C V3.4b , L = Lattice C V4.0)
  118. I experienced a loss of aprox. one second per minute in the AmiCron
  119. wakeups, since it was send to sleep for a fixed amount of time (59
  120. seconds). The time Cron did spent in "bed" increased with the
  121. length of the command call and the workload of the machine
  122. (especially I/O ints. like disk access). 
  123. So I now align to the to the next minute and keep this alignment by
  124. tranquilizing the task only for the remaining time 'till the next
  125. minute. Although the goal of starting it on the minute may only work
  126. if there is no heavy workload on your machine, this delay is at least
  127. not cumulative, like the one in the original version.
  128. Another odd thing is that the Delay() function (nasty AmigaDog) 
  129. obviously creates 5 I/O ints. per second (measured with SysMon
  130. by Perry S. Kivolovitz). 
  131. Although I couldn't detect any performance decreases caused by these
  132. interrupts, I decided to use the TimeDelay function from the Timer.c
  133. RKM example by Rob Peck in version 2.4 of AmiCron. Besides creating
  134. no I/O ints., I found that the TimeDelay() function is not effected
  135. by other I/O ints., so it turned out to be MUCH more accurate than
  136. the Delay() function and therefore worth compiling & linking that
  137. timer.c part.  
  138. I also included the path command line parameter, a check for the 
  139. existance of the CronTab file and tighten up the code here and there.
  140.  
  141. Some hints for the serious AmiCron addict: 
  142. If don't wanna AmiCron to stumble  through your default path and
  143. blast you with requesters (i.e you sometimes remove a disk with
  144. utilities on which you have a path assigned to), why not defining
  145. your own path in the StartCron batch file? Quite simple, but very
  146. effective.
  147. AmiCron can be easyly terminated (on it's next wakeup) by typing
  148. Ctrl-C in its window or by sending it a break using the BREAK
  149. command.  
  150.  
  151. This project/enhancement/fix is a combined effort by:
  152.                           
  153. ______  /          
  154. ______\O                    - The Software Brewery - 
  155.       \\                          
  156.        o            Sparkling, fresh software from W.-Germany
  157.                  
  158.      @@@@@          Straight from the bar to your Amiga
  159.      |~~~|\        
  160.      | | |/        
  161.      |___|        With our regards to the Software Distillery
  162. ---------------------------------------------------------------------
  163.  
  164. a West-German group of (hopefully professional) Amiga programmers
  165. inspired by the Software Destillery 
  166. (but we germans are more into brewing & drinking beer <grin>).
  167.  
  168. Programming & documentation by <CB>
  169.  
  170. <CB> is : Christian Balzer 
  171.           Im Wingertsberg 45
  172.           D-6108 Weiterstadt
  173.           W. Germany
  174.  
  175. Aztec C support by Christof Bonnkirch (another CB :-) )
  176. Further support/ideas by Peter Stark, Heiko Rath and Ralf Woitinas.
  177.  
  178. I would like to thank Steve R. Sampson for his initial PD cron, Rick
  179. Schaeffer for his port to the Amiga, Rob Peck for all the work he
  180. did and will (hopefully) do in the future and especially Fred Fish
  181. for his continuous effort to spread all that fantastic PD software 
  182. all over the world, without all of them I wouldn't have done this.   
  183. <CB>
  184.